/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.otis.DataFetch;


import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
/**
 *
 * @author Administrator
 */



public class Labcon {
Connection con = null;
public Connection getLocalConnection()

{
try
{
 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
 con = DriverManager.getConnection("jdbc:odbc:webstars", "webstars", "webstars");

}
catch (ClassNotFoundException e)
{

System.out.println(e);

}
catch (SQLException e)
{
System.out.println(e);
}

return con;
}

public Connection getLocalConnectionOtis()

{
try
{
 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
 con = DriverManager.getConnection("jdbc:odbc:otis", "WebstarBW", "WebstarBW@123");

}
catch (ClassNotFoundException e)
{

System.out.println(e);

}
catch (SQLException e)
{
System.out.println(e);
}

return con;
}

public Connection getLocalConnectionAccessControl()

{
try
{
 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
 con = DriverManager.getConnection("jdbc:odbc:control", "control", "control");

}
catch (ClassNotFoundException e)
{

System.out.println(e);

}
catch (SQLException e)
{
System.out.println(e);
}

return con;
}

public void setConnectionClose() throws SQLException
{
con.close();
}

public void setConnectionCloseOtis() throws SQLException
{
con.close();
}

public void setConnectionCloseAccessControl() throws SQLException
{
con.close();
}
}